#ifndef __C_VIDEO_HANDLER_H_INCLUDED__
#define __C_VIDEO_HANDLER_H_INCLUDED__
#include "IVideoHandler.h"
#include "irrList.h"
#include "IDeviceManager.h"

namespace game
{
	namespace video
	{
		class CVideoHandler : public IVideoHandler
		{
		public:
			//! Destructor
			virtual ~CVideoHandler();

			//! Default constructor
			CVideoHandler(IDeviceManager* deviceManager);

			//! Adds action for run in main render thread
			virtual void pushAction(delegateAction* action);

			//! Gets next action for run it in main render thread. Action was delete from delegates storage. 
			virtual delegateAction* popAction();

			//! Gets actions count
			virtual u32 getSize();

			//! Gets texture in video thread
			virtual irr::video::ITexture* getTexture(const c8* file, const c8* name);
			
			//! Load texture to entry
			virtual void getTexture(scene::STextureEntry* entry);

		private:

			void CVideoHandler::getTextureInVideoThread(void* data);

			IDeviceManager* DeviceManager;

			irr::core::array<delegateAction*> Actions;
		};
	}

}
#endif